<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\Route;

//获取banner
Route::get('api/:version/banner/:id','api/:version.Banner/getBanner',[],['id'=>'\d+']); 
//获取精选主题 
Route::get('api/:version/theme','api/:version.Theme/getSimpleList');
//获取指定精选主题及主题下的商品
Route::get('api/:version/theme/:id','api/:version.Theme/getComplexOne',[],['id'=>'\d+']);
//获取最近新品
Route::get('api/:version/product/recent/:count','api/:version.Product/getRecent');
//获取指定类目下的所有商品
Route::get('api/:version/product/by_category/:id','api/:version.Product/getAllInCategory'); 
//获取指定商品详情
Route::get('api/:version/product/:id','api/:version.Product/getOne',[],['id'=>'\d+']);
//获取所有类目
Route::get('api/:version/category/all','api/:version.Category/getAllCategories');


//获取用户token
Route::post('api/:version/token/user','api/:version.Token/getToken');
//获取apptoken
Route::post('api/:version/token/app','api/:version.Token/getAppToken');
//检验token
Route::post('api/:version/token/verify','api/:version.Token/verifyToken');


//新增或更新用户地址
Route::post('api/:version/address','api/:version.Address/createOrUpdateAddress');
//获取用户地址
Route::get('api/:version/address', 'api/:version.Address/getUserAddress');


//下单接口
Route::post('api/:version/order', 'api/:version.Order/placeOrder');
//微信支付接口
Route::post('api/:version/pay/pre_order', 'api/:version.Pay/getPreOrder');
//微信回调接口
Route::post('api/:version/pay/notify', 'api/:version.Pay/receiveNotify');
//我的订单接口
Route::get('api/:version/order/by_user', 'api/:version.Order/getOrdersByUser');
//获取订单详情接口
Route::get('api/:version/order/:id', 'api/:version.Order/getOrderDetail',[],['id'=>'\d+']);
//获取订单分页数据
Route::get('api/:version/order/paginate', 'api/:version.Order/getSummary');
//订单发货接口
Route::put('api/:version/order/delivery', 'api/:version.Order/delivery');


